<template>
  <div
    class="container"
    style="background: #ff6000; width: 1270px; height: 800px; display: flex"
  >
    <div class="box">
      <img
        src="https://img.zcool.cn/community/018d4c597e9063a8012156037896f3.jpg@1280w_1l_2o_100sh.jpg"
        width="600px"
        alt=""
      />
      <br />
      <br />
      姓名：<el-input
        placeholder="请输入内容"
        v-model="name"
        clearable
        style="width: 300px"
      >
      </el-input>
      <br />
      <br />
      昵称：<el-input
        placeholder="请输入内容"
        v-model="nike"
        clearable
        style="width: 300px"
      >
      </el-input>
      <br />
      <br />
      <el-button @click="fun">默认按钮</el-button>
    <h2>英语刚来</h2>
    </div>
  </div>
</template>
<style scoped>
.box {
  width: 1100px;
  height: 700px;
  margin: auto;
  background: #fff;
  box-shadow: 0px 0px 10px #ccc;
  border-radius: 10px;
}
</style>
<script>
import axios from "axios";
// import {md5} from "ts-md5/dist/md5"
export default {
  data() {
    return {
      name: "12",
      nike: "20",
      num: "123456",
    };
  },
  methods: {
    fun() {
      // let str = "nbsp123ok";
      // let data = {
      //   name: this.name,
      //   role: this.nike,
      //   sign: this.md5(this.name + this.nike + str + this.num),
      // };
      // console.log(this.md5(this.name + this.nike + str + this.num));
      // let obj = {
      //   "Content-type": "application/json;charset=UTF-8",
      //   strheader: this.num, //token换成从缓存获取
      // };
      // this.$apiPost(
      //   "/api/index.php/index/callcenter/getheaders",
      //   data,
      //   obj
      // ).then((res) => {
      //   console.log(res);
      // });

      // ------------------------------------------------------------------------------------------------
      axios
        .post(
          "/api/index.php/index/callcenter/getheaders",
          {
            name: this.name,
            role: this.nike,
            sign: this.md5(this.name + this.nike + 'nbsp123ok' + this.num),
          }
          ,
          {
           headers:{
            // "Content-Type": "application/json;charset=UTF-8",
            strheader: this.num,
          }
          }

        )
        .then((res) => {
          console.log(res.data);
        });
    },
  },
  mounted() {
    // this.fun();
  },
  components: {},
};
</script>

